package com.sindvision.cces.http;

import lombok.Data;

import java.io.Serializable;

@Data

public class ApiResult implements Serializable {

    public static ApiResultVO success(Object object) {
        ApiResultVO vo = new ApiResultVO();
        vo.setCode("0");
        vo.setInfo("成功");
        vo.setData(object);
        vo.setOk(true);
        return vo;
    }

    public static ApiResultVO success() {
        return success(null);
    }

    public static ApiResultVO error(String code, String info) {
        ApiResultVO vo = new ApiResultVO();
        vo.setCode(code);
        vo.setInfo(info);
        vo.setOk(false);
        return vo;
    }
}
